package top.huhuiyu.springboot3.service;

import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;

public class BaseApiService {
    public static final String ID = "lkoxhphwlpwzbgij";
    public static final String SECRET = "6aL7lrF2HlvWJ34ky8TWKS2bwerdm8Fg";
    public static final String HISTORY_URL = "https://www.mxnzp.com/api/history/today?type=%s";

    /**
     * 构建http请求头，里面包含认证信息
     *
     * @return http请求头
     */
    public HttpEntity<String> buildHttpEntity() {
        HttpEntity<String> httpEntity;
        HttpHeaders headers = new HttpHeaders();
        headers.add("app_id", ID);
        headers.add("app_secret", SECRET);
        httpEntity = new HttpEntity<>("", headers);
        return httpEntity;
    }
}
